package com.cy.store.controller;

import com.cy.store.pojo.District;
import com.cy.store.service.IDistrictService;
import com.cy.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @PROJECT_NAME: store
 * @DESCRIPTION:
 * @USER: 28416
 * @DATE: 2022/11/5 20:36
 */
@RequestMapping("districts")
@RestController
public class DistrictController  extends  BaseController{
    @Autowired
    private IDistrictService departmentService;
    @RequestMapping({"/",""})
    public JsonResult<List<District>> getByParentId(String parent){
        List<District> data = departmentService.getByParent(parent);

        return new JsonResult<>(OK,data);

    }
}
